package com.wyk.common.excption;

import com.wyk.common.result.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author WangYuKai
 * @Date 2022/8/11
 * @apiNote
 */
@ControllerAdvice
public class GloadExcptionConfig extends RuntimeException {

    @ExceptionHandler(Exception.class)
    @ResponseBody
    public Result Exception(Exception e){
        return Result.fail(e.getMessage());
    }
}
